package com.wkbb.common.enums;

/**
 * 企微用户类型（1:学生,2:老师,3:家长）
 */
public enum CpUserTypeEnum {

    STUDENT(1, "学生"),
    TEACHER(2, "老师"),
    FAMILY(3, "家长");

    private Integer value;

    private String desc;

    private CpUserTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public static String getDesc(Integer value) {
        for (CpUserTypeEnum userType : CpUserTypeEnum.values()) {
            if (userType.getValue().intValue() == value.intValue()) {
                return userType.getDesc();
            }
        }
        return null;
    }
}
